home *** CD-ROM | disk | FTP | other *** search
/ Freelog 112 / FreelogNo112-NovembreDecembre2012.iso / Jeu / deadlyrace / deadlyrace_setup.exe / {app} / Data / Scripts / logo_na.lua < prev    next >
Encoding:
Text File  |  2009-08-26  |  1.2 KB  |  63 lines

  1. local script = globalObject;
  2.  
  3. local interface;
  4. local commandMap = {};
  5.  
  6. local function ExecuteCommands()
  7.     while(SetNextCommand(script))
  8.     do
  9.         local command = GetCurrentCommand(script);
  10.         if (commandMap[command])
  11.         then
  12.             commandMap[command]();
  13.         end
  14.     end
  15. end
  16.  
  17. local function AddObject()
  18.     local obj = GetCurrentParams(script);
  19.     interface = StringToPointer(obj);
  20.     local x,y = GetTextureSize("fsdata/logo_na.png");
  21.     SetWindowVisible(interface, "logo", true);
  22.     SetWindowSize(interface, "logo", x, y);
  23.     UpdateInterfaceBuffers(interface);
  24.     
  25. end
  26.  
  27. local function SetVisible()
  28.     local num = tonumber(GetCurrentParams(script));
  29.     if (num == 0)
  30.     then
  31.         SetWindowVisible(interface, "logo", false);
  32.     else
  33.         SetWindowVisible(interface, "logo", true);
  34.     end
  35.     UpdateInterfaceBuffers(interface);
  36.     
  37. end
  38.  
  39. local function DeleteObject()
  40.     Release(interface);
  41.     StopScript(script);
  42.     interface = nil;
  43. end
  44.  
  45. local function ReleaseAll()
  46.     Release(interface);
  47.     interface = nil;
  48. end
  49.  
  50.  
  51.  
  52. commandMap["release_all"] = ReleaseAll;
  53. commandMap["add_object"] = AddObject;
  54. commandMap["delete_object"] = DeleteObject;
  55. commandMap["set_visible"] = SetVisible;
  56.  
  57. while(true)
  58. do
  59.     ExecuteCommands();
  60.     UpdateInterface(interface);
  61.     Update();
  62. end
  63.